package com.tuyou.cloud.hystrix.controller;

import com.tuyou.cloud.hystrix.service.HelloFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ConsumerController {

//    @Autowired
//    HelloRibbonService helloService;

    @Autowired
    HelloFeignService helloService;

    @RequestMapping(value = "/hystrix-hello", method = RequestMethod.GET)
    public String hello() {
        return helloService.hello();
    }

    @RequestMapping(value = "/hystrix-param", method = RequestMethod.GET)
    public String param() throws InterruptedException {
        return helloService.param("tuyou", 26);
    }
}
